<extend name="Bbs/base"/>
<block name="main">
    <section class="container main">
        {$sysNotice}
        <div class="index-container clearfix">
            <div class="index-aside">
                <div class="panel">
                    <div class="panel-header">
                        <h3 class="panel-title bbs-title">{$author['nick']}</h3>
                    </div>
                    <div class="panel-body">
                        <div class="bbs-info">
                            <a class="photo bbs-photo" href=""><img src="https://dn-phphub.qbox.me/uploads/avatars/815_1427370965.png?imageView2/1/w/100/h/100" alt=""></a>
                            <p><strong>{:formatCount($tie['visit'])}</strong> 浏览 • <strong>{:formatCount($author['gx'])}</strong> 贡献度</p>
                            <p>{$author['desc']}</p>
                            <p class="handle"><a class="handle-donation" id="donationBtn" href="javascript:void(0)">打赏</a></p>
                        </div>
                    </div>
                </div>
            </div>
            <div class="index-main">
                <div class="panel">
                    <div class="panel-header">
                        <h1 class="topic-title"><a href="{:U('/topic/'.$tie['id'])}">{$tie.title}</a></h1>
                        <p class="topic-info">
                            <if condition="$cate[$tie['cid']]"><a href="//bbs.wooo.wang/{$tie.bid}/group/{$tie['cid']}"># {$cate[$tie['cid']]}</a><else/><a href="//bbs.wooo.wang/{$tie.bid}/group/0"># 默认</a></if> • <a href="//wooo.wang/u/{$tie.uid}">{$author.nick}</a> • 发布于 {:formatTime($tie['create'])} • {:formatCount($tie['reply'])} 回复 • {:formatCount($tie['visit'])} 阅读
                        </p>
                    </div>
                    <div class="panel-body">
                        <div class="wooo">
                            {$tie.html}
                        </div>
                    </div>
                </div>
                <div class="panel">
                    <div class="panel-header">
                        <p>回复数量：<strong>{$tie.reply}</strong></p>
                    </div>
                    <div class="panel-body">
                        <ul class="reply-list">
                            <if condition="$list">
                                <volist name="list" id="vo">
                                    <li>
                                        <a class="photo reply-photo" href="//wooo.wang/u/{$vo.uid}" title="{$vo.nick}"><img src="{$vo.avatar}" alt="{$vo.nick}"></a>
                                        <div class="reply-container">
                                            <p class="reply-author">
                                                <a href="//wooo.wang/u/{$vo.uid}" title="{$vo.nick}" class="reply-author">{$vo.nick}</a> <span class="introduction">{$vo.desc}</span>
                                            </p>
                                            <div class="wooo">
                                                {$vo.html}
                                            </div>
                                            <p class="reply-handle">{:formatTime($vo['create'])} • <a href="javascript:void(0)">回复</a></p>
                                        </div>
                                    </li>
                                </volist>
                                <else/>
                                <p class="no-login-msg">当前暂无回复...</p>
                            </if>
                        </ul>
                    </div>
                    <div class="panel-footer">
                        {$page}
                    </div>
                </div>
                <div class="panel">
                    <div class="panel-body">
                        <if condition="UID">
                            <div class="tips">
                                <ul class="tips-list">
                                    <li>请注意单词拼写，以及中英文排版，<a href="https://github.com/sparanoid/chinese-copywriting-guidelines">参考此页</a>
                                    </li>
                                    <li>支持 Markdown 格式, <strong>**粗体**</strong>、~~删除线~~、<code>`单行代码`</code>, 更多语法请见这里 <a href="https://github.com/riku/Markdown-Syntax-CN/blob/master/syntax.md">Markdown 语法</a>
                                    </li>
                                    <li>支持上传图片，格式限制 - jpg, png, gif</li>
                                    <li>感谢有你，我将尽我最大的努力将系统开发得更好</li>
                                </ul>
                            </div>
                            <form action="/reply/{$tie['id']}" method="post" id="form">
                                <input type="hidden" name="html" id="html">
                                <div class="editor">
                                    <div class="editor-header">
                                        <a href="javascript:void(0)" id="imgBtn"><span class="icon-image"></span></a><a
                                            href="javascript:void(0)" id="previewBtn" class="preview"><span
                                            class="icon-switch"></span></a>
                                    </div>
                                    <div class="editor-body">
                                        <textarea id="content" name="" tabIndex="3" placeholder="编辑内容..."></textarea>
                                        <div class="md-preview wooo hide" id="shadeSec"></div>
                                    </div>
                                    <p class="editor-footer"><span>Ctrl + Enter</span>&nbsp;&nbsp;&nbsp;<a
                                            href="javascript:void(0)" id="submitBtn" tabIndex="4">发 起</a></p>
                                </div>
                            </form>
                            <else/>
                            <p class="no-login-msg">如果您想回复话题，您需要先 <a href="//wooo.wang/qqlogin">登录</a></p>
                        </if>
                    </div>
                </div>
            </div>
            <div class="index-aside">
                <div class="panel hide">
                    <div class="panel-header">
                        <h3 class="panel-title">邀请回答</h3>
                    </div>
                    <div class="panel-body invite">
                        <label for="email">通过邮件邀请别人回复</label>
                        <input type="text" id="email" placeholder="Email ..."/>
                        <p><a href="" id="inviteBtn">邀请</a></p>
                    </div>
                </div>
                <div class="panel">
                    <div class="panel-header">
                        <h3 class="panel-title">广告</h3>
                    </div>
                    <div class="panel-body">
                        <volist name="ad" id="vo">
                            <a href="{$vo.url}" target="_blank"><img width="100%" src="{$vo.img}" title="{$vo.desc}"></a>
                        </volist>
                    </div>
                </div>
                <div class="panel">
                    <div class="panel-header">
                        <h3 class="panel-title">分享至</h3>
                    </div>
                    <div class="panel-body">
                        <p class="bbs-share">
                            <a href="http://www.jiathis.com/send/?webid=qzone&amp;url=http://bbs.wooo.wang/topic/{$tie['id']}&amp;title={$tie['title']} - 我网[wooo.wang]，分享与收获知识、经验、见解的团体协作书写平台！" id="shareQQ" title="分享到QQ空间" target="_blank"><span class="icon-weixin"></span></a>
                            <a href="http://www.jiathis.com/send/?webid=qzone&amp;url=http://bbs.wooo.wang/topic/{$tie['id']}&amp;title={$tie['title']} - 我网[wooo.wang]，分享与收获知识、经验、见解的团体协作书写平台！" id="shareQQ1" title="分享到QQ空间" target="_blank"><span class="icon-qq"></span></a>
                            <a href="http://www.jiathis.com/send/?webid=qzone&amp;url=http://bbs.wooo.wang/topic/{$tie['id']}&amp;title={$tie['title']} - 我网[wooo.wang]，分享与收获知识、经验、见解的团体协作书写平台！" id="shareQQ2" title="分享到QQ空间" target="_blank"><span class="icon-weibo"></span></a>
                        </p>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <if condition="UID">
        <div class="modal hide" id="modal">
            <div class="modal-container" style="max-width:400px;margin-top:20%;">
                <div class="modal-content">
                    <div class="modal-header">
                        <button class="modal-close" id="modalClose"><span>&times;</span></button>
                        <h4 class="modal-title">捐赠贡献度</h4>
                    </div>
                    <div class="modal-body">
                        <div class="form">
                            <div class="form-item">
                                <input type="number" name="gx" id="gxInput" data-gx="{$user.gx}" min="1" max="{$user.gx}" placeholder="请填写您捐赠的贡献度...">
                            </div>
                        </div>
                        <p class="edit-tip">您当前拥有 <strong class="red" id="userAllGx">{$user.gx}</strong> 点贡献度...</p>
                    </div>
                    <div class="modal-footer">
                        <button class="modal-no" id="modalNo">取消</button>
                        <button class="modal-save no-save" id="modalOk" data-url="//wooo.wang/user/donation/uid/{$tie['uid']}">确认</button>
                    </div>
                </div>
            </div>
        </div>
    </if>
</block>
<block name="js">
    <script src="__STATIC__/doc/js/donation.js?v=__VERSION__"></script>
    <script src="__STATIC__/common/js/marked.js?v=__VERSION__"></script>
    <script src="__STATIC__/common/js/qiniu/plupload.full.min.js?v=__VERSION__"></script>
    <script src="__STATIC__/common/js/qiniu/qiniu.js?v=__VERSION__"></script>
    <script>
        var token = "{$token|default = ''}", bid = "{$bbs.id}", uid = "{:UID}";
    </script>
    <script src="__STATIC__/bbs/js/publish.js?v=__VERSION__"></script>
    <script src="__STATIC__/bbs/js/tie.js?v=__VERSION__"></script>
</block>